library(tidyverse)## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.3.6 ✔ purrr 0.3.5
## ✔ tibble 3.1.8 ✔ dplyr 1.0.10
## ✔ tidyr 1.2.1 ✔ stringr 1.4.1
## ✔ readr 2.1.3 ✔ forcats 0.5.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
library(MSstatsPTM)
library(lme4)## Loading required package: Matrix
## Warning: package 'Matrix' was built under R version 4.2.2
##
## Attaching package: 'Matrix'
##
## The following objects are masked from 'package:tidyr':
##
## expand, pack, unpack
library(msqrob2)## Loading required package: QFeatures
## Loading required package: MultiAssayExperiment
## Loading required package: SummarizedExperiment
## Loading required package: MatrixGenerics
## Loading required package: matrixStats
##
## Attaching package: 'matrixStats'
##
## The following object is masked from 'package:dplyr':
##
## count
##
##
## Attaching package: 'MatrixGenerics'
##
## The following objects are masked from 'package:matrixStats':
##
## colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
## colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
## colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
## colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
## colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
## colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
## colWeightedMeans, colWeightedMedians, colWeightedSds,
## colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
## rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
## rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
## rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
## rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
## rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
## rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
## rowWeightedSds, rowWeightedVars
##
## Loading required package: GenomicRanges
## Loading required package: stats4
## Loading required package: BiocGenerics
##
## Attaching package: 'BiocGenerics'
##
## The following objects are masked from 'package:dplyr':
##
## combine, intersect, setdiff, union
##
## The following objects are masked from 'package:stats':
##
## IQR, mad, sd, var, xtabs
##
## The following objects are masked from 'package:base':
##
## anyDuplicated, append, as.data.frame, basename, cbind, colnames,
## dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
## grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
## order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
## rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
## union, unique, unsplit, which.max, which.min
##
## Loading required package: S4Vectors
##
## Attaching package: 'S4Vectors'
##
## The following objects are masked from 'package:Matrix':
##
## expand, unname
##
## The following objects are masked from 'package:dplyr':
##
## first, rename
##
## The following object is masked from 'package:tidyr':
##
## expand
##
## The following objects are masked from 'package:base':
##
## expand.grid, I, unname
##
## Loading required package: IRanges
##
## Attaching package: 'IRanges'
##
## The following objects are masked from 'package:dplyr':
##
## collapse, desc, slice
##
## The following object is masked from 'package:purrr':
##
## reduce
##
## The following object is masked from 'package:grDevices':
##
## windows
##
## Loading required package: GenomeInfoDb
## Loading required package: Biobase
## Welcome to Bioconductor
##
## Vignettes contain introductory material; view with
## 'browseVignettes()'. To cite Bioconductor, see
## 'citation("Biobase")', and for packages 'citation("pkgname")'.
##
##
## Attaching package: 'Biobase'
##
## The following object is masked from 'package:MatrixGenerics':
##
## rowMedians
##
## The following objects are masked from 'package:matrixStats':
##
## anyMissing, rowMedians
##
##
## Attaching package: 'QFeatures'
##
## The following object is masked from 'package:MultiAssayExperiment':
##
## longFormat
##
## The following object is masked from 'package:base':
##
## sweep
library(data.table)##
## Attaching package: 'data.table'
##
## The following object is masked from 'package:SummarizedExperiment':
##
## shift
##
## The following object is masked from 'package:GenomicRanges':
##
## shift
##
## The following object is masked from 'package:IRanges':
##
## shift
##
## The following objects are masked from 'package:S4Vectors':
##
## first, second
##
## The following objects are masked from 'package:dplyr':
##
## between, first, last
##
## The following object is masked from 'package:purrr':
##
## transpose
Load in all data
directory = "C:/Users/Nina/OneDrive - UGent/Documenten/Doctoraat/msqrobPTM paper/biological ubiquitin dataset/"
#MSStats data
load(paste0(directory, "MSstatsSummarizedData.RData"))
load(paste0(directory, "MSstatsModel.rda"))
#Msqrob
load("pe_ubiquitin_msqrob.rda")estimated ptm abundance ->fixef(model_ptm\(Model.Details\)PTM[[100]]) protein abundance (for protein i) -> summarized_ptm\(PROTEIN\)ProteinLevelData %>% filter(Protein == i) %>% pull(LogIntensities) ptm abundance (for ptm i) -> summarized_ptm\(PTM\)ProteinLevelData %>% filter(Protein == i) %>% pull(LogIntensities) normalised ptm abundance -> model_ptm\(Model.Details\)PTM[[100]] - model_ptm\(Model.Details\)PROTEIN[[100]]
At the moment, only in the GitHub version, a detailed model gets outputted with info on the estimates on everything, so I used that here
originalRUN <- c("CCCP-B1T1", "CCCP-B1T2", "CCCP-B2T1", "CCCP-B2T2", "Combo-B1T1",
"Combo-B1T2", "Combo-B2T1", "Combo-B2T2", "Ctrl-B1T1", "Ctrl-B1T2",
"Ctrl-B2T1", "Ctrl-B2T2", "USP30_OE-B1T1", "USP30_OE-B1T2",
"USP30_OE-B2T1", "USP30_OE-B2T2")
GROUP <- sapply(strsplit(originalRUN, "-"), function(x) x[1])
## Plot fourty ptm's from Combo vs Ctrl
ptm_list1 <- model_ptm$ADJUSTED.Model %>% filter(Label == "Combo vs Ctrl") %>% filter(adj.pvalue <= 0.05) %>% head(40) %>% pull(Protein)
all_ptms <- model_ptm$PTM.Model %>% pull(Protein) %>% unique()
all_proteins <- model_ptm$PROTEIN.Model %>% pull(Protein) %>% unique()
adjusted_ptms <- model_ptm$ADJUSTED.Model %>% pull(Protein) %>% unique()
plots <- c()
for (i in ptm_list1){
print(i)
prot <- strsplit(i, "_")[[1]][1]
index <- which(all_ptms == i)
index_prot <- which(all_proteins == prot)
index_adjusted <- which(adjusted_ptms == i)
#Protein abundance
protein <- tibble(originalRUN, GROUP)
protein$FeatureType <- "Protein"
protein$Protein <- prot
tmp <- summarized_ptm$PROTEIN$ProteinLevelData %>% filter(Protein == prot) %>%
select(c(LogIntensities, originalRUN))
missing_runs <- setdiff(originalRUN, tmp$originalRUN)
tmp2 <- tibble(originalRUN = missing_runs, LogIntensities = NA)
tmp3 <- rbind(tmp, tmp2) %>% arrange(originalRUN) %>% select(LogIntensities)
protein <- cbind(protein, tmp3)
#PTM abundance
ptm_df <- summarized_ptm$PTM$ProteinLevelData %>% filter(Protein == i)
ptm_df$Abundance <- ptm_df$LogIntensities
ptm_df$FeatureType <- "PTM"
ptm_df <- ptm_df %>% select(c("Protein", "LogIntensities", "originalRUN",
"GROUP", "FeatureType"))
#PTM estimated (maar nog niet adjusted)
Protein <- rep(i, length(originalRUN))
ptm_estimate <- tibble(Protein)
ptm_estimate$originalRUN <- originalRUN
ptm_estimate$GROUP <- GROUP
ptm_estimate$FeatureType <- "PTM_estimated"
ptm_estimate$LogIntensities <- NA
#Check that model estimates are definitely from that PTM
if (class(model_ptm$Model.Details$PTM[[index]]) == "lm"){print(i)
}else{
print(all(
summarized_ptm$PTM$ProteinLevelData %>% filter(Protein == i) %>% pull(LogIntensities) ==
getME(model_ptm$Model.Details$PTM[[index]], "y")
))}
if (class(model_ptm$Model.Details$PTM[[index]]) == "lm"){
fixeffects <- model_ptm$Model.Details$PTM[[index]]$coefficients
} else {fixeffects <- fixef(model_ptm$Model.Details$PTM[[index]])}
ptm_estimate[ptm_estimate$GROUP=="CCCP",]$LogIntensities <-
fixeffects[["(Intercept)"]]
try(ptm_estimate[ptm_estimate$GROUP=="Combo",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("Combo", names(fixeffects))])
try(ptm_estimate[ptm_estimate$GROUP=="Ctrl",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("Ctrl", names(fixeffects))])
try(ptm_estimate[ptm_estimate$GROUP=="USP30_OE",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("USP30_OE", names(fixeffects))])
#Protein estimated (maar nog niet adjusted)
Protein <- rep(prot, length(originalRUN))
prot_estimate <- tibble(Protein)
prot_estimate$originalRUN <- originalRUN
prot_estimate$GROUP <- GROUP
prot_estimate$FeatureType <- "Protein_estimated"
prot_estimate$LogIntensities <- NA
#Check that model estimates are definitely from that PTM
if (class(model_ptm$Model.Details$PROTEIN[[index_prot]]) == "lmerMod"){
print(all(
summarized_ptm$PROTEIN$ProteinLevelData %>% filter(Protein == prot) %>% pull(LogIntensities) ==
getME(model_ptm$Model.Details$PROTEIN[[index_prot]], "y")))
}
if (class(model_ptm$Model.Details$PROTEIN[[index_prot]]) == "lm"){
fixeffects <- model_ptm$Model.Details$PROTEIN[[index_prot]]$coefficients
} else {fixeffects <- fixef(model_ptm$Model.Details$PROTEIN[[index_prot]])}
prot_estimate[prot_estimate$GROUP=="CCCP",]$LogIntensities <-
fixeffects[["(Intercept)"]]
try(prot_estimate[prot_estimate$GROUP=="Combo",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("Combo", names(fixeffects))])
try(prot_estimate[prot_estimate$GROUP=="Ctrl",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("Ctrl", names(fixeffects))])
try(prot_estimate[prot_estimate$GROUP=="USP30_OE",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("USP30_OE", names(fixeffects))])
#PTM normalised
Protein <- rep(i, length(originalRUN))
ptm_norm <- tibble(Protein)
ptm_norm$originalRUN <- originalRUN
ptm_norm$GROUP <- GROUP
ptm_norm$FeatureType <- "PTM_normalised"
ptm_norm$LogIntensities <- ptm_estimate$LogIntensities - prot_estimate$LogIntensities
plot_df <- rbindlist(list(protein, ptm_df, ptm_estimate, prot_estimate, ptm_norm), fill = TRUE)
plot_points <- rbindlist(list(protein, ptm_df), fill = TRUE)
#plot_df[plot_df$FeatureType == 'Model'][['FeatureType']] <- "PTM Summarized"
#plot_df[plot_df$FeatureType == 'Peptide'][['FeatureType']] <- "PTM Feature"
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = originalRUN, y = LogIntensities , group = FeatureType, color = FeatureType), size =2) +
geom_point(data = plot_points, aes(x = originalRUN, y = LogIntensities ,
group = FeatureType, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("PTM" = "palevioletred1", "PTM_estimated" = "deeppink4",
"Protein" = "palegreen2",
"Protein_estimated" = "seagreen4",
"PTM_normalised" = "goldenrod2")) +
#scale_size_manual(values = c(1, 2)) +
labs(title = i, x = "BioReplicate", y = "LogIntensity") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=11.5),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0.05)) +
annotate("text", x = 2.5, y = 30, label = "CCCP", size = 8) +
annotate("text", x = 6.5, y = 30, label = "Combo", size = 8) +
annotate("text", x = 10.5, y = 30, label = "Ctrl", size = 8) +
annotate("text", x = 14.5, y = 30, label = "USP30", size = 8) +
ylim(-6, 30)
plots[[i]] <- p1
}## [1] "A0FGR9_K608"
## [1] "A0FGR9_K608"
## [1] "B2RB47_K073"
## [1] "B2RB47_K073"
## [1] "O00154_K205"
## [1] "O00154_K205"
## [1] TRUE
## [1] "O00159_K0578"
## [1] TRUE
## [1] TRUE
## [1] "O00170_K215"
## [1] "O00170_K215"
## [1] TRUE
## [1] "O00232_K262"
## [1] "O00232_K262"
## [1] TRUE
## [1] "O00267_K0627"
## [1] "O00267_K0627"
## [1] TRUE
## [1] "O00410_K0806"
## [1] TRUE
## [1] TRUE
## [1] "O14972_K103"
## [1] TRUE
## [1] "O14980_K0686"
## [1] "O14980_K0686"
## [1] TRUE
## [1] "O15372_K274"
## [1] "O15372_K274"
## [1] TRUE
## [1] "O43175_K289"
## [1] TRUE
## [1] TRUE
## [1] "O43670_K100"
## [1] TRUE
## [1] "O43847_K0993"
## [1] "O43847_K0993"
## [1] "O60260_K076"
## [1] TRUE
## [1] TRUE
## [1] "O60260_K220"
## [1] TRUE
## [1] TRUE
## [1] "O60260_K369"
## [1] TRUE
## [1] TRUE
## [1] "O60260_K408"
## [1] TRUE
## [1] TRUE
## [1] "O60260_K435"
## [1] "O60260_K435"
## [1] TRUE
## [1] "O60341_K492"
## [1] "O60341_K492"
## [1] "O60361_K034"
## [1] "O60361_K034"
## [1] TRUE
## [1] "O60361_K041"
## [1] TRUE
## [1] TRUE
## [1] "O60361_K070"
## [1] "O60361_K070"
## [1] TRUE
## [1] "O60361_K109"
## [1] TRUE
## [1] TRUE
## [1] "O60361_K113"
## [1] "O60361_K113"
## Error : Assigned data `fixeffects[["(Intercept)"]] + ...` must be compatible with existing data.
## ✖ Existing data has 4 rows.
## ✖ Assigned data has 0 rows.
## ℹ Only vectors of size 1 are recycled.
## [1] TRUE
## [1] "O60506_K336"
## [1] TRUE
## [1] TRUE
## [1] "O60749_K218"
## [1] TRUE
## [1] "O60749_K516"
## [1] "O60749_K516"
## [1] "O60832_K433"
## [1] "O60832_K433"
## [1] TRUE
## [1] "O60888_K082"
## [1] "O60888_K082"
## [1] TRUE
## [1] "O75131_K158"
## [1] "O75131_K158"
## Error : Assigned data `fixeffects[["(Intercept)"]] + ...` must be compatible with existing data.
## ✖ Existing data has 4 rows.
## ✖ Assigned data has 0 rows.
## ℹ Only vectors of size 1 are recycled.
## [1] "O75150_K440"
## [1] "O75150_K440"
## Error : Assigned data `fixeffects[["(Intercept)"]] + ...` must be compatible with existing data.
## ✖ Existing data has 4 rows.
## ✖ Assigned data has 0 rows.
## ℹ Only vectors of size 1 are recycled.
## [1] "O75400_K669"
## [1] "O75400_K669"
## [1] TRUE
## [1] "O75694_K0740"
## [1] TRUE
## [1] "O75694_K0824"
## [1] "O75694_K0824"
## [1] "O75694_K0890"
## [1] "O75694_K0890"
## [1] "O75694_K0902"
## [1] TRUE
## [1] "O75694_K0987"
## [1] TRUE
## [1] "O75694_K1069"
## [1] "O75694_K1069"
## [1] "O75694_K1126"
## [1] TRUE
plots## $A0FGR9_K608
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 8 rows containing missing values (geom_point).
##
## $B2RB47_K073
## Warning: Removed 10 row(s) containing missing values (geom_path).
## Warning: Removed 9 rows containing missing values (geom_point).
##
## $O00154_K205
## Warning: Removed 1 rows containing missing values (geom_point).
##
## $O00159_K0578
##
## $O00170_K215
##
## $O00232_K262
##
## $O00267_K0627
##
## $O00410_K0806
##
## $O14972_K103
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 8 rows containing missing values (geom_point).
##
## $O14980_K0686
## Warning: Removed 1 row(s) containing missing values (geom_path).
## Warning: Removed 4 rows containing missing values (geom_point).
##
## $O15372_K274
## Warning: Removed 1 rows containing missing values (geom_point).
##
## $O43175_K289
##
## $O43670_K100
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 8 rows containing missing values (geom_point).
##
## $O43847_K0993
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Removed 8 rows containing missing values (geom_point).
##
## $O60260_K076
##
## $O60260_K220
##
## $O60260_K369
##
## $O60260_K408
##
## $O60260_K435
##
## $O60341_K492
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 9 rows containing missing values (geom_point).
##
## $O60361_K034
##
## $O60361_K041
##
## $O60361_K070
##
## $O60361_K109
##
## $O60361_K113
##
## $O60506_K336
##
## $O60749_K218
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 8 rows containing missing values (geom_point).
##
## $O60749_K516
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Removed 8 rows containing missing values (geom_point).
##
## $O60832_K433
## Warning: Removed 1 rows containing missing values (geom_point).
##
## $O60888_K082
##
## $O75131_K158
## Warning: Removed 14 row(s) containing missing values (geom_path).
## Warning: Removed 11 rows containing missing values (geom_point).
##
## $O75150_K440
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Removed 11 rows containing missing values (geom_point).
##
## $O75400_K669
##
## $O75694_K0740
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 8 rows containing missing values (geom_point).
##
## $O75694_K0824
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Removed 8 rows containing missing values (geom_point).
##
## $O75694_K0890
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Removed 8 rows containing missing values (geom_point).
##
## $O75694_K0902
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Removed 8 rows containing missing values (geom_point).
##
## $O75694_K0987
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Removed 8 rows containing missing values (geom_point).
##
## $O75694_K1069
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Removed 8 rows containing missing values (geom_point).
##
## $O75694_K1126
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Removed 8 rows containing missing values (geom_point).
model_ptm$ADJUSTED.Model %>% filter(Protein == "O60260_K369", Label == "Combo vs Ctrl")estimated ptm abundance -> rowData(pe[[“ptmRel”]])\(msqrobModels\)P18124_K029 %>% getCoef() protein abundance -> assay(pe[[“proteinRobust”]]) ptm abundance -> this I do not have, is already normalised normalised ptm abundance -> assay(pe[[“ptmRel”]])
## Plot ptm's from Combo vs Ctrl
ptm_list2 <- rowData(pe[["ptmRel"]])$groupCombo %>% filter(adjPval <= 0.05) %>% rownames()
plots <- c()
for (i in ptm_list2){
print(i)
prot <- strsplit(i, "_")[[1]][1]
#Protein abundance
protein <- assay(pe[["proteinRaw"]])[prot,] %>% as.data.frame()
colnames(protein) <- "LogIntensities"
protein <- protein %>%
mutate(Protein = prot,
FeatureType = "Protein",
GROUP = sapply(strsplit(rownames(protein), "-"), function(x) x[1])) %>%
rownames_to_column("originalRUN") %>%
arrange(GROUP, originalRUN)
#Peptidoform abundance
pepforms <- rowData(pe[["peptidoformRaw"]]) %>% as.data.frame() %>%
filter(ptm == i) %>% rownames
pepform <- assay(pe[["peptidoformRaw"]])[pepforms,] %>% as.data.frame()
if (length(pepforms)==0) {next}
if (length(pepforms)>1){
pepform <- pepform %>% rownames_to_column("Protein") %>%
pivot_longer(cols = colnames(pepform), names_to = "originalRUN",
values_to = "LogIntensities")
pepform$GROUP <- sapply(strsplit(pepform$originalRUN, "-"), function(x) x[1])
pepform <- pepform %>% arrange(GROUP, originalRUN)
} else {colnames(pepform) <- "LogIntensities"
pepform <- pepform %>% rownames_to_column("originalRUN")
pepform <- pepform %>% mutate(GROUP =
sapply(strsplit(pepform$originalRUN, "-"), function(x) x[1]),
Protein = pepforms[1]) %>%
arrange(GROUP, originalRUN)
}
pepform <- pepform %>%
mutate(FeatureType = "Peptidoform")
#pepform <- select(-c("pepform"))
pepform$originalRUN <- forcats::fct_inorder(pepform$originalRUN)
#Peptidoform abundance - normalised
pepforms <- rowData(pe[["pepformRel"]]) %>% as.data.frame() %>%
filter(ptm == i) %>% rownames
pepform_norm <- assay(pe[["pepformRel"]])[pepforms,] %>% as.data.frame()
if (length(pepforms)>1){
pepform_norm <- pepform_norm %>% rownames_to_column("Protein") %>%
pivot_longer(cols = colnames(pepform_norm), names_to = "originalRUN",
values_to = "LogIntensities")
pepform_norm$GROUP <- sapply(strsplit(pepform_norm$originalRUN, "-"), function(x) x[1])
pepform_norm <- pepform_norm %>% arrange(GROUP, originalRUN) %>%
mutate(Protein = paste(Protein,"norm"))
} else {colnames(pepform_norm) <- "LogIntensities"
pepform_norm <- pepform_norm %>% rownames_to_column("originalRUN")
pepform_norm <- pepform_norm %>% mutate(GROUP =
sapply(strsplit(pepform_norm$originalRUN, "-"), function(x) x[1]),
Protein = paste(pepforms[1],"norm")) %>%
arrange(GROUP, originalRUN)
}
pepform_norm <- pepform_norm %>%
mutate(FeatureType = "Peptidoform - normalised")
#pepform <- select(-c("pepform"))
pepform_norm$originalRUN <- forcats::fct_inorder(pepform_norm$originalRUN)
#Normalised PTM abundance
ptm_df <- assay(pe[["ptmRel"]])[i,] %>% as.data.frame()
colnames(ptm_df) <- "LogIntensities"
ptm_df <- ptm_df %>%
mutate(Protein = i,
FeatureType = "PTM - normalised",
GROUP = sapply(strsplit(rownames(ptm_df), "-"), function(x) x[1])) %>%
rownames_to_column("originalRUN") %>%
arrange(GROUP, originalRUN)
#PTM estimated
Protein <- paste(rep(i, nrow(ptm_df)), "estimate")
ptm_estimate <- tibble(Protein)
ptm_estimate$originalRUN <- ptm_df$originalRUN
ptm_estimate$GROUP <- ptm_df$GROUP
ptm_estimate$FeatureType <- "PTM_estimated"
ptm_estimate$LogIntensities <- NA
fixeffects <- rowData(pe[["ptmRel"]])$msqrobModels[[i]] %>% getCoef
ptm_estimate[ptm_estimate$GROUP=="Ctrl",]$LogIntensities <-
fixeffects[["(Intercept)"]]
ptm_estimate[ptm_estimate$GROUP=="Combo",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("Combo", names(fixeffects))][1]
ptm_estimate[ptm_estimate$GROUP=="CCCP",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("CCCP", names(fixeffects))][1]
ptm_estimate[ptm_estimate$GROUP=="USP30_OE",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("USP30_OE", names(fixeffects))][1]
ptm_estimate <- ptm_estimate %>% arrange(GROUP, originalRUN)
plot_df <- rbindlist(list(protein, pepform, pepform_norm, ptm_df, ptm_estimate), fill = TRUE)
plot_df$originalRUN <- forcats::fct_inorder(plot_df$originalRUN)
plot_points <- plot_df %>% filter(FeatureType != "PTM_estimated")
#plot_df[plot_df$FeatureType == 'Model'][['FeatureType']] <- "PTM Summarized"
#plot_df[plot_df$FeatureType == 'Peptide'][['FeatureType']] <- "PTM Feature"
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = originalRUN, y = LogIntensities , group = Protein, color = FeatureType), size =2) +
geom_point(data = plot_points, aes(x = originalRUN, y = LogIntensities , group = Protein, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("Peptidoform - normalised" = "#C3C3C3",
"Protein" = "dodgerblue2", "PTM - normalised" = "seagreen3",
"PTM_estimated" = "palevioletred2", "Peptidoform" = "gray36")) +
#scale_size_manual(values = c(1, 2)) +
labs(title = i, x = "BioReplicate", y = "LogIntensity") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=10),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0.05)) +
annotate("text", x = 2.5, y = 30, label = "CCCP", size = 8) +
annotate("text", x = 6.5, y = 30, label = "Combo", size = 8) +
annotate("text", x = 10.5, y = 30, label = "Ctrl", size = 8) +
annotate("text", x = 14.5, y = 30, label = "USP30", size = 8) +
ylim(-5, 30)
plots[[i]] <- p1
}## [1] "O43242_K273"
## [1] "O94826_K168"
## [1] "O94826_K300"
## [1] "O94826_K078"
## [1] "P00387_K115"
## [1] "P05023_K0671"
## [1] "P05023_K0727"
## [1] "P14618_K207"
## [1] "P19367_K501"
## [1] "P21333_K0906"
## [1] "P36578_K106"
## [1] "P46777_K027"
## [1] "P46781_K121"
## [1] "P52789_K041"
## [1] "P54920_K227"
## [1] "P56937_K321"
## [1] "P60174_K051"
## [1] "P61247_K056"
## [1] "P61978_K052"
## [1] "Q00610_K0911"
## [1] "Q13332_K1685"
## [1] "Q13485_K070"
## [1] "Q14566_K611"
## [1] "Q15154_K0970"
## [1] "Q8WXW3_K708"
## [1] "Q969Z3_K294"
## [1] "Q99613_K712"
## [1] "Q9NZ45_K089"
## [1] "Q9UHP3_K0201"
## [1] "Q9Y490_K0334"
plots## $O43242_K273
##
## $O94826_K168
## Warning: Removed 26 row(s) containing missing values (geom_path).
## Warning: Removed 44 rows containing missing values (geom_point).
##
## $O94826_K300
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 18 rows containing missing values (geom_point).
##
## $O94826_K078
## Warning: Removed 10 row(s) containing missing values (geom_path).
## Warning: Removed 39 rows containing missing values (geom_point).
##
## $P00387_K115
## Warning: Removed 42 row(s) containing missing values (geom_path).
## Warning: Removed 69 rows containing missing values (geom_point).
##
## $P05023_K0671
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 17 rows containing missing values (geom_point).
##
## $P05023_K0727
## Warning: Removed 6 rows containing missing values (geom_point).
##
## $P14618_K207
## Warning: Removed 14 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
##
## $P19367_K501
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 11 rows containing missing values (geom_point).
##
## $P21333_K0906
## Warning: Removed 6 rows containing missing values (geom_point).
##
## $P36578_K106
## Warning: Removed 2 rows containing missing values (geom_point).
##
## $P46777_K027
##
## $P46781_K121
## Warning: Removed 20 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $P52789_K041
## Warning: Removed 3 rows containing missing values (geom_point).
##
## $P54920_K227
##
## $P56937_K321
## Warning: Removed 23 row(s) containing missing values (geom_path).
## Warning: Removed 27 rows containing missing values (geom_point).
##
## $P60174_K051
## Warning: Removed 3 rows containing missing values (geom_point).
##
## $P61247_K056
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
##
## $P61978_K052
##
## $Q00610_K0911
##
## $Q13332_K1685
## Warning: Removed 3 rows containing missing values (geom_point).
##
## $Q13485_K070
##
## $Q14566_K611
##
## $Q15154_K0970
## Warning: Removed 14 row(s) containing missing values (geom_path).
## Warning: Removed 22 rows containing missing values (geom_point).
##
## $Q8WXW3_K708
## Warning: Removed 3 rows containing missing values (geom_point).
##
## $Q969Z3_K294
## Warning: Removed 40 row(s) containing missing values (geom_path).
## Warning: Removed 56 rows containing missing values (geom_point).
##
## $Q99613_K712
##
## $Q9NZ45_K089
## Warning: Removed 70 row(s) containing missing values (geom_path).
## Warning: Removed 114 rows containing missing values (geom_point).
##
## $Q9UHP3_K0201
## Warning: Removed 24 row(s) containing missing values (geom_path).
## Warning: Removed 52 rows containing missing values (geom_point).
##
## $Q9Y490_K0334
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 4 rows containing missing values (geom_point).
## Plot ptm's from CCCP vs Ctrl
ptm_listCCCP <- rowData(pe[["ptmRel"]])$groupCCCP %>% filter(adjPval <= 0.05) %>% rownames()
plots <- c()
for (i in ptm_listCCCP){
print(i)
prot <- strsplit(i, "_")[[1]][1]
#Protein abundance
protein <- assay(pe[["proteinRaw"]])[prot,] %>% as.data.frame()
colnames(protein) <- "LogIntensities"
protein <- protein %>%
mutate(Protein = prot,
FeatureType = "Protein",
GROUP = sapply(strsplit(rownames(protein), "-"), function(x) x[1])) %>%
rownames_to_column("originalRUN") %>%
arrange(GROUP, originalRUN)
#Peptidoform abundance
pepforms <- rowData(pe[["peptidoformRaw"]]) %>% as.data.frame() %>%
filter(ptm == i) %>% rownames
pepform <- assay(pe[["peptidoformRaw"]])[pepforms,] %>% as.data.frame()
if (length(pepforms)==0) {next}
if (length(pepforms)>1){
pepform <- pepform %>% rownames_to_column("Protein") %>%
pivot_longer(cols = colnames(pepform), names_to = "originalRUN",
values_to = "LogIntensities")
pepform$GROUP <- sapply(strsplit(pepform$originalRUN, "-"), function(x) x[1])
pepform <- pepform %>% arrange(GROUP, originalRUN)
} else {colnames(pepform) <- "LogIntensities"
pepform <- pepform %>% rownames_to_column("originalRUN")
pepform <- pepform %>% mutate(GROUP =
sapply(strsplit(pepform$originalRUN, "-"), function(x) x[1]),
Protein = pepforms[1]) %>%
arrange(GROUP, originalRUN)
}
pepform <- pepform %>%
mutate(FeatureType = "Peptidoform")
#pepform <- select(-c("pepform"))
pepform$originalRUN <- forcats::fct_inorder(pepform$originalRUN)
#Peptidoform abundance - normalised
pepforms <- rowData(pe[["pepformRel"]]) %>% as.data.frame() %>%
filter(ptm == i) %>% rownames
pepform_norm <- assay(pe[["pepformRel"]])[pepforms,] %>% as.data.frame()
if (length(pepforms)>1){
pepform_norm <- pepform_norm %>% rownames_to_column("Protein") %>%
pivot_longer(cols = colnames(pepform_norm), names_to = "originalRUN",
values_to = "LogIntensities")
pepform_norm$GROUP <- sapply(strsplit(pepform_norm$originalRUN, "-"), function(x) x[1])
pepform_norm <- pepform_norm %>% arrange(GROUP, originalRUN) %>%
mutate(Protein = paste(Protein,"norm"))
} else {colnames(pepform_norm) <- "LogIntensities"
pepform_norm <- pepform_norm %>% rownames_to_column("originalRUN")
pepform_norm <- pepform_norm %>% mutate(GROUP =
sapply(strsplit(pepform_norm$originalRUN, "-"), function(x) x[1]),
Protein = paste(pepforms[1],"norm")) %>%
arrange(GROUP, originalRUN)
}
pepform_norm <- pepform_norm %>%
mutate(FeatureType = "Peptidoform - normalised")
#pepform <- select(-c("pepform"))
pepform_norm$originalRUN <- forcats::fct_inorder(pepform_norm$originalRUN)
#Normalised PTM abundance
ptm_df <- assay(pe[["ptmRel"]])[i,] %>% as.data.frame()
colnames(ptm_df) <- "LogIntensities"
ptm_df <- ptm_df %>%
mutate(Protein = i,
FeatureType = "PTM - normalised",
GROUP = sapply(strsplit(rownames(ptm_df), "-"), function(x) x[1])) %>%
rownames_to_column("originalRUN") %>%
arrange(GROUP, originalRUN)
#PTM estimated
Protein <- paste(rep(i, nrow(ptm_df)), "estimate")
ptm_estimate <- tibble(Protein)
ptm_estimate$originalRUN <- ptm_df$originalRUN
ptm_estimate$GROUP <- ptm_df$GROUP
ptm_estimate$FeatureType <- "PTM_estimated"
ptm_estimate$LogIntensities <- NA
fixeffects <- rowData(pe[["ptmRel"]])$msqrobModels[[i]] %>% getCoef
ptm_estimate[ptm_estimate$GROUP=="Ctrl",]$LogIntensities <-
fixeffects[["(Intercept)"]]
ptm_estimate[ptm_estimate$GROUP=="Combo",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("Combo", names(fixeffects))][1]
ptm_estimate[ptm_estimate$GROUP=="CCCP",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("CCCP", names(fixeffects))][1]
ptm_estimate[ptm_estimate$GROUP=="USP30_OE",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("USP30_OE", names(fixeffects))][1]
ptm_estimate <- ptm_estimate %>% arrange(GROUP, originalRUN)
plot_df <- rbindlist(list(protein, pepform, pepform_norm, ptm_df, ptm_estimate), fill = TRUE)
plot_df$originalRUN <- forcats::fct_inorder(plot_df$originalRUN)
plot_points <- plot_df %>% filter(FeatureType != "PTM_estimated")
#plot_df[plot_df$FeatureType == 'Model'][['FeatureType']] <- "PTM Summarized"
#plot_df[plot_df$FeatureType == 'Peptide'][['FeatureType']] <- "PTM Feature"
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = originalRUN, y = LogIntensities , group = Protein, color = FeatureType), size =2) +
geom_point(data = plot_points, aes(x = originalRUN, y = LogIntensities , group = Protein, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("Peptidoform - normalised" = "#C3C3C3",
"Protein" = "dodgerblue2", "PTM - normalised" = "seagreen3",
"PTM_estimated" = "palevioletred2", "Peptidoform" = "gray36")) +
#scale_size_manual(values = c(1, 2)) +
labs(title = i, x = "BioReplicate", y = "LogIntensity") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=10),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0.05)) +
annotate("text", x = 2.5, y = 30, label = "CCCP", size = 8) +
annotate("text", x = 6.5, y = 30, label = "Combo", size = 8) +
annotate("text", x = 10.5, y = 30, label = "Ctrl", size = 8) +
annotate("text", x = 14.5, y = 30, label = "USP30", size = 8) +
ylim(-5, 30)
plots[[i]] <- p1
}## [1] "O94826_K168"
## [1] "O94826_K300"
## [1] "P00387_K115"
## [1] "P05023_K0727"
## [1] "P14618_K207"
## [1] "P19367_K501"
## [1] "P61247_K056"
## [1] "Q14566_K611"
## [1] "Q15154_K0970"
## [1] "Q9BYC9_K114"
## [1] "Q9UHP3_K0201"
## [1] "Q9Y490_K0334"
plots## $O94826_K168
## Warning: Removed 26 row(s) containing missing values (geom_path).
## Warning: Removed 44 rows containing missing values (geom_point).
##
## $O94826_K300
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 18 rows containing missing values (geom_point).
##
## $P00387_K115
## Warning: Removed 42 row(s) containing missing values (geom_path).
## Warning: Removed 69 rows containing missing values (geom_point).
##
## $P05023_K0727
## Warning: Removed 6 rows containing missing values (geom_point).
##
## $P14618_K207
## Warning: Removed 14 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
##
## $P19367_K501
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 11 rows containing missing values (geom_point).
##
## $P61247_K056
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
##
## $Q14566_K611
##
## $Q15154_K0970
## Warning: Removed 14 row(s) containing missing values (geom_path).
## Warning: Removed 22 rows containing missing values (geom_point).
##
## $Q9BYC9_K114
## Warning: Removed 8 rows containing missing values (geom_point).
##
## $Q9UHP3_K0201
## Warning: Removed 24 row(s) containing missing values (geom_path).
## Warning: Removed 52 rows containing missing values (geom_point).
##
## $Q9Y490_K0334
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 4 rows containing missing values (geom_point).
plots <- list()
for (i in ptm_list2){
prot_ = str_split(i, "_")[[1]][1]
site_ = str_split(i, "_")[[1]][2]
pepform_df <- longFormat(pe[,,"pepformRel"], rowvars = c("protein", "ptm"), colvars = c("group")) %>% as.data.frame()
pepform_df <- pepform_df %>% filter(protein == prot_)
pepform_df <- pepform_df %>% filter(grepl(site_, ptm, fixed = T))
pepform_df$FeatureType <- "Peptide"
pepform_df <- pepform_df %>% arrange(group, rowname)
ptm_df <- longFormat(pe[,,"ptmRel"], rowvars = c("protein", "ptm"), colvars = c("group")) %>% as.data.frame()
ptm_df <- ptm_df %>% filter(ptm == i)
ptm_df$FeatureType <- "PTM"
ptm_df <- ptm_df %>% arrange(group, rowname)
plot_df <- rbindlist(list(pepform_df, ptm_df), fill = TRUE)
plot_df[plot_df$FeatureType == 'PTM'][['FeatureType']] <- "PTM Summarized"
plot_df[plot_df$FeatureType == 'Peptide'][['FeatureType']] <- "PTM Feature"
plot_df$primary <- forcats::fct_inorder(plot_df$primary)
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = primary, y = value , group = rowname, color = FeatureType), size =2) +
geom_point(aes(x = primary, y = value , group = rowname, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("#C3C3C3", "#D55E00")) +
#scale_size_manual(values = c(1, 2)) +
labs(title = i, x = "BioReplicate", y = "Abundance") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=10),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0)) +
annotate("text", x = 2.5, y = 6.5, label = "Ctrl", size = 6) +
annotate("text", x = 6.5, y = 6.5, label = "CCCP", size = 6) +
annotate("text", x = 10.5, y = 6.5, label = "Combo", size = 6) +
annotate("text", x = 14.5, y = 6.5, label = "USP30", size = 6) +
ylim(-6, 6.5)
plots[[i]] <- p1
}## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
## Warning: 'experiments' dropped; see 'metadata'
## harmonizing input:
## removing 128 sampleMap rows not in names(experiments)
plots## $O43242_K273
##
## $O94826_K168
## Warning: Removed 12 row(s) containing missing values (geom_path).
## Warning: Removed 22 rows containing missing values (geom_point).
##
## $O94826_K300
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 9 rows containing missing values (geom_point).
##
## $O94826_K078
## Warning: Removed 7 row(s) containing missing values (geom_path).
## Warning: Removed 20 rows containing missing values (geom_point).
##
## $P00387_K115
## Warning: Removed 20 row(s) containing missing values (geom_path).
## Warning: Removed 33 rows containing missing values (geom_point).
##
## $P05023_K0671
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 12 rows containing missing values (geom_point).
##
## $P05023_K0727
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 4 rows containing missing values (geom_point).
##
## $P14618_K207
## Warning: Removed 11 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
##
## $P19367_K501
## Warning: Removed 1 row(s) containing missing values (geom_path).
## Warning: Removed 6 rows containing missing values (geom_point).
##
## $P21333_K0906
## Warning: Removed 3 rows containing missing values (geom_point).
##
## $P36578_K106
## Warning: Removed 1 rows containing missing values (geom_point).
##
## $P46777_K027
##
## $P46781_K121
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 12 rows containing missing values (geom_point).
##
## $P52789_K041
## Warning: Removed 2 rows containing missing values (geom_point).
##
## $P54920_K227
##
## $P56937_K321
## Warning: Removed 12 row(s) containing missing values (geom_path).
## Warning: Removed 14 rows containing missing values (geom_point).
##
## $P60174_K051
## Warning: Removed 2 rows containing missing values (geom_point).
##
## $P61247_K056
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 8 rows containing missing values (geom_point).
##
## $P61978_K052
##
## $Q00610_K0911
##
## $Q13332_K1685
## Warning: Removed 2 rows containing missing values (geom_point).
##
## $Q13485_K070
##
## $Q14566_K611
##
## $Q15154_K0970
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 11 rows containing missing values (geom_point).
##
## $Q8WXW3_K708
## Warning: Removed 2 rows containing missing values (geom_point).
##
## $Q969Z3_K294
## Warning: Removed 20 row(s) containing missing values (geom_path).
## Warning: Removed 28 rows containing missing values (geom_point).
##
## $Q99613_K712
##
## $Q9NZ45_K089
## Warning: Removed 37 row(s) containing missing values (geom_path).
## Warning: Removed 57 rows containing missing values (geom_point).
##
## $Q9UHP3_K0201
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 26 rows containing missing values (geom_point).
##
## $Q9Y490_K0334
## Warning: Removed 4 rows containing missing values (geom_point).
Plots of MSstats first 40 significant PTMs
## Plot fourty ptm's from Combo vs Ctrl
plots <- c()
for (i in ptm_list1){
print(i)
if(!i %in% rownames(assay(pe[["ptmRel"]]))){
print(paste(i, "not in msqrob"))
next
}
if(i %in% ptm_list2){print(paste(i, "also significant with msqrob"))}
prot <- strsplit(i, "_")[[1]][1]
#Protein abundance
protein <- assay(pe[["proteinRaw"]])[prot,] %>% as.data.frame()
colnames(protein) <- "LogIntensities"
protein <- protein %>%
mutate(Protein = prot,
FeatureType = "Protein",
GROUP = sapply(strsplit(rownames(protein), "-"), function(x) x[1])) %>%
rownames_to_column("originalRUN") %>%
arrange(GROUP)
#Peptidoform abundance
pepforms <- rowData(pe[["pepformRel"]]) %>% as.data.frame() %>%
filter(ptm == i) %>% rownames
pepform <- assay(pe[["pepformRel"]])[pepforms,] %>% as.data.frame()
if((nrow(rowData(pe[["peptidoformRaw"]]) %>% as.data.frame() %>%
filter(ptm == i))==0)){next}
if (length(pepforms)==0){
print(paste(i, "not in normalised PTM data"))
pepforms <- rowData(pe[["peptidoformRaw"]]) %>% as.data.frame() %>%
filter(ptm == i) %>% rownames
pepform <- assay(pe[["peptidoformRaw"]])[pepforms,] %>% as.data.frame()
if (length(pepforms)>1){
pepform <- pepform %>% rownames_to_column("Protein") %>%
pivot_longer(cols = colnames(pepform), names_to = "originalRUN",
values_to = "LogIntensities")
pepform$GROUP <- sapply(strsplit(pepform$originalRUN, "-"), function(x) x[1])
pepform <- pepform %>% arrange(pepform, GROUP)
} else {colnames(pepform) <- "LogIntensities"
pepform <- pepform %>% rownames_to_column("originalRUN")
pepform <- pepform %>% mutate(GROUP =
sapply(strsplit(pepform$originalRUN, "-"), function(x) x[1]),
Protein = pepforms[1]) %>%
arrange(GROUP)
}
pepform <- pepform %>%
mutate(FeatureType = "pepform - unnormalised")
plot_df <- rbindlist(list(protein, pepform), fill = TRUE)
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = originalRUN, y = LogIntensities , group = Protein, color = FeatureType), size =2) +
geom_point(aes(x = originalRUN, y = LogIntensities , group = Protein, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("pepform - unnormalised" = "lightgoldenrod", "Protein" = "palegreen2",
"PTM" = "palevioletred2", "PTM_estimated" = "deeppink4")) +
#scale_size_manual(values = c(1, 2)) +
labs(title = paste(i, "no normalisation possible"), x = "BioReplicate", y = "LogIntensity") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=10),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0.05)) +
annotate("text", x = 2.5, y = 27, label = "CCCP", size = 8) +
annotate("text", x = 6.5, y = 27, label = "Combo", size = 8) +
annotate("text", x = 10.5, y = 27, label = "Ctrl", size = 8) +
annotate("text", x = 14.5, y = 27, label = "USP30", size = 8) +
ylim(-7, 27)
plots[[i]] <- p1
next
}
if (length(pepforms)>1){
pepform <- pepform %>% rownames_to_column("Protein") %>%
pivot_longer(cols = colnames(pepform), names_to = "originalRUN",
values_to = "LogIntensities")
pepform$GROUP <- sapply(strsplit(pepform$originalRUN, "-"), function(x) x[1])
pepform <- pepform %>% arrange(pepform, GROUP) %>%
mutate(Protein = paste(Protein, "normalised"))
} else {colnames(pepform) <- "LogIntensities"
pepform <- pepform %>% rownames_to_column("originalRUN")
pepform <- pepform %>% mutate(GROUP =
sapply(strsplit(pepform$originalRUN, "-"), function(x) x[1]),
Protein = paste(pepforms[1], "normalised")) %>%
arrange(GROUP)
}
pepform <- pepform %>%
mutate(FeatureType = "Peptidoform - Normalised")
pepform$originalRUN <- forcats::fct_inorder(pepform$originalRUN)
pepforms_raw <- rowData(pe[["peptidoformRaw"]]) %>% as.data.frame() %>%
filter(ptm == i) %>% rownames
pepform_raw <- assay(pe[["peptidoformRaw"]])[pepforms_raw,] %>% as.data.frame()
if (length(pepforms_raw)>1){
pepform_raw <- pepform_raw %>% rownames_to_column("Protein") %>%
pivot_longer(cols = colnames(pepform_raw), names_to = "originalRUN",
values_to = "LogIntensities")
pepform_raw$GROUP <- sapply(strsplit(pepform_raw$originalRUN, "-"), function(x) x[1])
pepform_raw <- pepform_raw %>% arrange(pepform_raw, GROUP)
} else {colnames(pepform_raw) <- "LogIntensities"
pepform_raw <- pepform_raw %>% rownames_to_column("originalRUN")
pepform_raw <- pepform_raw %>% mutate(GROUP =
sapply(strsplit(pepform_raw$originalRUN, "-"), function(x) x[1]),
Protein = pepforms_raw[1]) %>%
arrange(GROUP)
}
pepform_raw <- pepform_raw %>%
mutate(FeatureType = "Peptidoform")
#Normalised PTM abundance
ptm_df <- assay(pe[["ptmRel"]])[i,] %>% as.data.frame()
colnames(ptm_df) <- "LogIntensities"
ptm_df <- ptm_df %>%
mutate(Protein = i,
FeatureType = "PTM - normalised",
GROUP = sapply(strsplit(rownames(ptm_df), "-"), function(x) x[1])) %>%
rownames_to_column("originalRUN") %>%
arrange(GROUP)
#PTM estimated
Protein <- paste(rep(i, nrow(ptm_df)), "estimate")
ptm_estimate <- tibble(Protein)
ptm_estimate$originalRUN <- ptm_df$originalRUN
ptm_estimate$GROUP <- ptm_df$GROUP
ptm_estimate$FeatureType <- "PTM_estimated"
ptm_estimate$LogIntensities <- NA
fixeffects <- rowData(pe[["ptmRel"]])$msqrobModels[[i]] %>% getCoef
if (! all(is.finite(fixeffects))){print(paste(i, "no refitting possible"))
next}
ptm_estimate[ptm_estimate$GROUP=="Ctrl",]$LogIntensities <-
fixeffects[["(Intercept)"]]
ptm_estimate[ptm_estimate$GROUP=="Combo",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("Combo", names(fixeffects))][1]
ptm_estimate[ptm_estimate$GROUP=="CCCP",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("CCCP", names(fixeffects))][1]
ptm_estimate[ptm_estimate$GROUP=="USP30_OE",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("USP30_OE", names(fixeffects))][1]
plot_df <- rbindlist(list(protein, pepform, ptm_df, ptm_estimate, pepform_raw), fill = TRUE)
plot_df$originalRUN <- as.vector(plot_df$originalRUN)
plot_df <- plot_df %>% arrange(FeatureType, originalRUN)
plot_df$originalRUN <- forcats::fct_inorder(plot_df$originalRUN)
plot_points <- plot_df %>% filter(FeatureType != "PTM_estimated")
#plot_df[plot_df$FeatureType == 'Model'][['FeatureType']] <- "PTM Summarized"
#plot_df[plot_df$FeatureType == 'Peptide'][['FeatureType']] <- "PTM Feature"
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = originalRUN, y = LogIntensities , group = Protein, color = FeatureType), size =2) +
geom_point(data = plot_points, aes(x = originalRUN, y = LogIntensities , group = Protein, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("Peptidoform - normalised" = "#C3C3C3",
"Protein" = "palegreen2", "PTM - normalised" = "goldenrod2",
"PTM_estimated" = "deeppink4", "Peptidoform" = "gray36"))+
#scale_size_manual(values = c(1, 2)) +
labs(title = i, x = "BioReplicate", y = "LogIntensity") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=11.3),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0.05)) +
annotate("text", x = 2.5, y = 30, label = "CCCP", size = 8) +
annotate("text", x = 6.5, y = 30, label = "Combo", size = 8) +
annotate("text", x = 10.5, y = 30, label = "Ctrl", size = 8) +
annotate("text", x = 14.5, y = 30, label = "USP30", size = 8) +
ylim(-5, 30)
plots[[i]] <- p1
}## [1] "A0FGR9_K608"
## [1] "A0FGR9_K608 not in msqrob"
## [1] "B2RB47_K073"
## [1] "B2RB47_K073 not in msqrob"
## [1] "O00154_K205"
## [1] "O00159_K0578"
## [1] "O00170_K215"
## [1] "O00232_K262"
## [1] "O00267_K0627"
## [1] "O00410_K0806"
## [1] "O14972_K103"
## [1] "O14980_K0686"
## [1] "O15372_K274"
## [1] "O43175_K289"
## [1] "O43670_K100"
## [1] "O43847_K0993"
## [1] "O60260_K076"
## [1] "O60260_K220"
## [1] "O60260_K369"
## [1] "O60260_K408"
## [1] "O60260_K435"
## [1] "O60341_K492"
## [1] "O60361_K034"
## [1] "O60361_K041"
## [1] "O60361_K070"
## [1] "O60361_K109"
## [1] "O60361_K113"
## [1] "O60361_K113 no refitting possible"
## [1] "O60506_K336"
## [1] "O60749_K218"
## [1] "O60749_K516"
## [1] "O60832_K433"
## [1] "O60888_K082"
## [1] "O75131_K158"
## [1] "O75150_K440"
## [1] "O75400_K669"
## [1] "O75694_K0740"
## [1] "O75694_K0824"
## [1] "O75694_K0890"
## [1] "O75694_K0902"
## [1] "O75694_K0987"
## [1] "O75694_K1069"
## [1] "O75694_K1126"
plots## $O00154_K205
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $O00159_K0578
## Warning: Removed 9 row(s) containing missing values (geom_path).
## Warning: Removed 18 rows containing missing values (geom_point).
##
## $O00170_K215
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 27 rows containing missing values (geom_point).
##
## $O00232_K262
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Removed 27 rows containing missing values (geom_point).
##
## $O00267_K0627
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $O00410_K0806
## Warning: Removed 40 row(s) containing missing values (geom_path).
## Warning: Removed 92 rows containing missing values (geom_point).
##
## $O14972_K103
## Warning: Removed 3 row(s) containing missing values (geom_path).
## Warning: Removed 3 rows containing missing values (geom_point).
##
## $O14980_K0686
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $O15372_K274
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 27 rows containing missing values (geom_point).
##
## $O43175_K289
## Warning: Removed 6 rows containing missing values (geom_point).
##
## $O43670_K100
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
##
## $O43847_K0993
## Warning: Removed 8 row(s) containing missing values (geom_path).
## Warning: Removed 35 rows containing missing values (geom_point).
##
## $O60260_K076
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 15 rows containing missing values (geom_point).
##
## $O60260_K220
## Warning: Removed 12 row(s) containing missing values (geom_path).
## Warning: Removed 46 rows containing missing values (geom_point).
##
## $O60260_K369
##
## $O60260_K408
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 18 rows containing missing values (geom_point).
##
## $O60260_K435
## Warning: Removed 16 row(s) containing missing values (geom_path).
## Warning: Removed 60 rows containing missing values (geom_point).
##
## $O60341_K492
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 27 rows containing missing values (geom_point).
##
## $O60361_K034
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Removed 27 rows containing missing values (geom_point).
##
## $O60361_K041
## Warning: Removed 8 row(s) containing missing values (geom_path).
## Warning: Removed 34 rows containing missing values (geom_point).
##
## $O60361_K070
## Warning: Removed 40 row(s) containing missing values (geom_path).
## Warning: Removed 71 rows containing missing values (geom_point).
##
## $O60361_K109
## Warning: Removed 14 row(s) containing missing values (geom_path).
## Warning: Removed 30 rows containing missing values (geom_point).
##
## $O60506_K336
## Warning: Removed 6 rows containing missing values (geom_point).
##
## $O60749_K218
## Warning: Removed 3 rows containing missing values (geom_point).
##
## $O60749_K516
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $O60832_K433
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 25 rows containing missing values (geom_point).
##
## $O60888_K082
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 27 rows containing missing values (geom_point).
##
## $O75131_K158
## Warning: Removed 10 row(s) containing missing values (geom_path).
## Warning: Removed 40 rows containing missing values (geom_point).
##
## $O75150_K440
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $O75400_K669
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Removed 24 rows containing missing values (geom_point).
##
## $O75694_K0740
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 22 rows containing missing values (geom_point).
##
## $O75694_K0824
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $O75694_K0890
## Warning: Removed 10 row(s) containing missing values (geom_path).
## Warning: Removed 45 rows containing missing values (geom_point).
##
## $O75694_K0902
## Warning: Removed 3 rows containing missing values (geom_point).
##
## $O75694_K0987
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 23 rows containing missing values (geom_point).
##
## $O75694_K1069
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 27 rows containing missing values (geom_point).
##
## $O75694_K1126
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 22 rows containing missing values (geom_point).
for (i in ptm_list1){
print(i)
if(!i %in% rownames(assay(pe[["ptmRel"]]))){
print(paste(i, "not in msqrob"))
next
}
print(rowData(pe[["ptmRel"]])$groupCombo[i,])
}## [1] "A0FGR9_K608"
## [1] "A0FGR9_K608 not in msqrob"
## [1] "B2RB47_K073"
## [1] "B2RB47_K073 not in msqrob"
## [1] "O00154_K205"
## logFC se df t pval adjPval
## O00154_K205 NA NA 5.561565 NA NA NA
## [1] "O00159_K0578"
## logFC se df t pval adjPval
## O00159_K0578 NA NA 6.566507 NA NA NA
## [1] "O00170_K215"
## logFC se df t pval adjPval
## O00170_K215 NA NA 4.561565 NA NA NA
## [1] "O00232_K262"
## logFC se df t pval adjPval
## O00232_K262 NA NA 4.561565 NA NA NA
## [1] "O00267_K0627"
## logFC se df t pval adjPval
## O00267_K0627 NA NA 5.561565 NA NA NA
## [1] "O00410_K0806"
## logFC se df t pval adjPval
## O00410_K0806 1.770579 0.5540462 11.23528 3.195725 0.008308075 0.3435982
## [1] "O14972_K103"
## logFC se df t pval adjPval
## O14972_K103 -0.3065211 1.961715 9.431339 -0.1562516 0.8791284 1
## [1] "O14980_K0686"
## logFC se df t pval adjPval
## O14980_K0686 NA NA 5.561565 NA NA NA
## [1] "O15372_K274"
## logFC se df t pval adjPval
## O15372_K274 NA NA 4.561565 NA NA NA
## [1] "O43175_K289"
## logFC se df t pval adjPval
## O43175_K289 NA NA 9.837067 NA NA NA
## [1] "O43670_K100"
## logFC se df t pval adjPval
## O43670_K100 0.06658972 0.1662865 11.00365 0.4004519 0.6964889 1
## [1] "O43847_K0993"
## logFC se df t pval adjPval
## O43847_K0993 NA NA 4.561565 NA NA NA
## [1] "O60260_K076"
## logFC se df t pval adjPval
## O60260_K076 0.9880622 1.108285 9.473871 0.8915238 0.3947268 1
## [1] "O60260_K220"
## logFC se df t pval adjPval
## O60260_K220 1.105436 1.265646 10.37847 0.873417 0.4021929 1
## [1] "O60260_K369"
## logFC se df t pval adjPval
## O60260_K369 -0.5466616 0.3494623 11.87849 -1.564294 0.143986 1
## [1] "O60260_K408"
## logFC se df t pval adjPval
## O60260_K408 1.441877 0.6890223 10.47664 2.092643 0.06160434 0.9415948
## [1] "O60260_K435"
## logFC se df t pval adjPval
## O60260_K435 NA NA 5.561565 NA NA NA
## [1] "O60341_K492"
## logFC se df t pval adjPval
## O60341_K492 NA NA 4.561565 NA NA NA
## [1] "O60361_K034"
## logFC se df t pval adjPval
## O60361_K034 NA NA 4.561565 NA NA NA
## [1] "O60361_K041"
## logFC se df t pval adjPval
## O60361_K041 -0.3289675 0.6228605 10.52565 -0.528156 0.6083458 1
## [1] "O60361_K070"
## logFC se df t pval adjPval
## O60361_K070 NA NA 5.561565 NA NA NA
## [1] "O60361_K109"
## logFC se df t pval adjPval
## O60361_K109 1.091522 1.167485 10.39397 0.9349342 0.3710344 1
## [1] "O60361_K113"
## logFC se df t pval adjPval
## O60361_K113 NA NA NA NA NA NA
## [1] "O60506_K336"
## logFC se df t pval adjPval
## O60506_K336 5.267339 4.133408 8.609018 1.274333 0.2358665 1
## [1] "O60749_K218"
## logFC se df t pval adjPval
## O60749_K218 0.0931323 0.3960529 9.755213 0.2351512 0.8189539 1
## [1] "O60749_K516"
## logFC se df t pval adjPval
## O60749_K516 NA NA 5.561565 NA NA NA
## [1] "O60832_K433"
## logFC se df t pval adjPval
## O60832_K433 NA NA 5.561565 NA NA NA
## [1] "O60888_K082"
## logFC se df t pval adjPval
## O60888_K082 NA NA 4.561565 NA NA NA
## [1] "O75131_K158"
## logFC se df t pval adjPval
## O75131_K158 NA NA 5.561565 NA NA NA
## [1] "O75150_K440"
## logFC se df t pval adjPval
## O75150_K440 NA NA 5.561565 NA NA NA
## [1] "O75400_K669"
## logFC se df t pval adjPval
## O75400_K669 NA NA 5.561565 NA NA NA
## [1] "O75694_K0740"
## logFC se df t pval adjPval
## O75694_K0740 -0.7723166 1.695731 10.37557 -0.4554475 0.6581702 1
## [1] "O75694_K0824"
## logFC se df t pval adjPval
## O75694_K0824 NA NA 5.561565 NA NA NA
## [1] "O75694_K0890"
## logFC se df t pval adjPval
## O75694_K0890 NA NA 5.561565 NA NA NA
## [1] "O75694_K0902"
## logFC se df t pval adjPval
## O75694_K0902 -0.7680094 2.026458 9.437002 -0.3789911 0.7130815 1
## [1] "O75694_K0987"
## logFC se df t pval adjPval
## O75694_K0987 -0.07075939 0.4983178 9.585284 -0.1419965 0.8900228 1
## [1] "O75694_K1069"
## logFC se df t pval adjPval
## O75694_K1069 NA NA 4.561565 NA NA NA
## [1] "O75694_K1126"
## logFC se df t pval adjPval
## O75694_K1126 2.708987 2.618607 10.43998 1.034515 0.3242647 1
estimated ptm abundance -> rowData(peMSstatsSum[[“ptmNorm”]])\(msqrobModels\)P18124_K029 %>% getCoef() protein abundance -> summarized_ptm\(PROTEIN\)ProteinLevelData %>% filter(Protein == i) %>% pull(LogIntensities) ptm abundance -> assay(peMSstatsSum[[“ptm]]) of summarized_ptm\(PTM\)ProteinLevelData %>% filter(Protein == i) %>% pull(LogIntensities) normalised ptm abundance -> assay(peMSstatsSum[[“ptmNorm]])
## Plot significant ptm's from Combo vs Ctrl
ptm_list3 <- rowData(pe[["ptmMSstatsRel"]])$groupCombo %>% filter(adjPval <= 0.05) %>% rownames()
plots <- c()
for (i in ptm_list3){
prot <- strsplit(i, "_")[[1]][1]
#Protein abundance
protein <- tibble(originalRUN, GROUP)
protein$FeatureType <- "Protein"
protein$Protein <- prot
tmp <- summarized_ptm$PROTEIN$ProteinLevelData %>% filter(Protein == prot) %>%
select(c(LogIntensities, originalRUN))
missing_runs <- setdiff(originalRUN, tmp$originalRUN)
tmp2 <- tibble(originalRUN = missing_runs, LogIntensities = NA)
tmp3 <- rbind(tmp, tmp2) %>% arrange(originalRUN) %>% select(LogIntensities)
protein <- cbind(protein, tmp3)
#PTM abundance
ptm_df <- tibble(originalRUN, GROUP)
ptm_df$FeatureType <- "PTM"
ptm_df$Protein <- i
tmp <- summarized_ptm$PTM$ProteinLevelData %>% filter(Protein == i) %>%
select(c(LogIntensities, originalRUN))
missing_runs <- setdiff(originalRUN, tmp$originalRUN)
tmp2 <- tibble(originalRUN = missing_runs, LogIntensities = NA)
tmp3 <- rbind(tmp, tmp2) %>% arrange(originalRUN) %>% select(LogIntensities)
ptm_df <- cbind(ptm_df, tmp3)
#Normalised PTM abundance
ptm_df_norm <- assay(pe[["ptmMSstatsRel"]])[i,] %>% as.data.frame()
colnames(ptm_df_norm) <- "LogIntensities"
ptm_df_norm <- ptm_df_norm %>%
mutate(Protein = i,
FeatureType = "PTM - normalised",
GROUP = sapply(strsplit(rownames(ptm_df_norm), "-"), function(x) x[1])) %>%
rownames_to_column("originalRUN") %>%
arrange(GROUP)
#PTM estimated
Protein <- rep(i, nrow(ptm_df))
ptm_estimate <- tibble(Protein)
ptm_estimate$originalRUN <- ptm_df$originalRUN
ptm_estimate$GROUP <- ptm_df$GROUP
ptm_estimate$FeatureType <- "PTM_estimated"
ptm_estimate$LogIntensities <- NA
fixeffects <- rowData(pe[["ptmMSstatsRel"]])$msqrobModels[[i]] %>% getCoef
ptm_estimate[ptm_estimate$GROUP=="Ctrl",]$LogIntensities <-
fixeffects[["(Intercept)"]]
ptm_estimate[ptm_estimate$GROUP=="Combo",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("Combo", names(fixeffects))][1]
ptm_estimate[ptm_estimate$GROUP=="CCCP",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("CCCP", names(fixeffects))][1]
ptm_estimate[ptm_estimate$GROUP=="USP30_OE",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("USP30_OE", names(fixeffects))][1]
plot_df <- rbindlist(list(protein, ptm_df_norm, ptm_df, ptm_estimate), fill = TRUE)
plot_df <- plot_df %>% arrange(FeatureType)
plot_df$originalRUN <- forcats::fct_inorder(plot_df$originalRUN)
plot_points <- plot_df %>% filter(FeatureType != "PTM_estimated")
#plot_df[plot_df$FeatureType == 'Model'][['FeatureType']] <- "PTM Summarized"
#plot_df[plot_df$FeatureType == 'Peptide'][['FeatureType']] <- "PTM Feature"
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = originalRUN, y = LogIntensities , group = FeatureType, color = FeatureType), size =2) +
geom_point(data = plot_points, aes(x = originalRUN, y = LogIntensities , group = FeatureType, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("PTM - normalised" = "lightgoldenrod", "Protein" = "skyblue3",
"PTM" = "seagreen3", "PTM_estimated" = "palevioletred2")) +
#scale_size_manual(values = c(1, 2)) +
labs(title = i, x = "BioReplicate", y = "LogIntensity") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=10),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0)) +
annotate("text", x = 2.5, y = 27, label = "CCCP", size = 8) +
annotate("text", x = 6.5, y = 27, label = "Combo", size = 8) +
annotate("text", x = 10.5, y = 27, label = "Ctrl", size = 8) +
annotate("text", x = 14.5, y = 27, label = "USP30", size = 8) +
ylim(-7, 27)
plots[[i]] <- p1
}
plots## $O60361_K109
## Warning: Removed 8 row(s) containing missing values (geom_path).
## Warning: Removed 8 rows containing missing values (geom_point).
##
## $P23396_K062
##
## $P23396_K075
##
## $P32969_K121
##
## $P46781_K066
##
## $P53621_K0825
## Warning: Removed 2 rows containing missing values (geom_point).
##
## $P62736_K328
## Warning: Removed 2 rows containing missing values (geom_point).
##
## $Q07020_K049
##
## $Q07955_K138
##
## $Q14683_K0536
##
## $Q9Y277_K053
## Warning: Removed 2 rows containing missing values (geom_point).
## Plot fourty ptm's from Combo vs Ctrl
originalRUN <- c("CCCP-B1T1", "CCCP-B1T2", "CCCP-B2T1", "CCCP-B2T2", "Combo-B1T1",
"Combo-B1T2", "Combo-B2T1", "Combo-B2T2", "Ctrl-B1T1", "Ctrl-B1T2",
"Ctrl-B2T1", "Ctrl-B2T2", "USP30_OE-B1T1", "USP30_OE-B1T2",
"USP30_OE-B2T1", "USP30_OE-B2T2")
GROUP <- sapply(strsplit(originalRUN, "-"), function(x) x[1])
plots <- c()
for (i in ptm_list1){
if (i %in% ptm_list3){print(paste(i, "also significant in msqrob"))}
prot <- strsplit(i, "_")[[1]][1]
#Protein abundance
protein <- tibble(originalRUN, GROUP)
protein$FeatureType <- "Protein"
protein$Protein <- prot
tmp <- summarized_ptm$PROTEIN$ProteinLevelData %>% filter(Protein == prot) %>%
select(c(LogIntensities, originalRUN))
missing_runs <- setdiff(originalRUN, tmp$originalRUN)
tmp2 <- tibble(originalRUN = missing_runs, LogIntensities = NA)
tmp3 <- rbind(tmp, tmp2) %>% arrange(originalRUN) %>% select(LogIntensities)
protein <- cbind(protein, tmp3)
#PTM abundance
ptm_df <- tibble(originalRUN, GROUP)
ptm_df$FeatureType <- "PTM"
ptm_df$Protein <- i
tmp <- summarized_ptm$PTM$ProteinLevelData %>% filter(Protein == i) %>%
select(c(LogIntensities, originalRUN))
missing_runs <- setdiff(originalRUN, tmp$originalRUN)
tmp2 <- tibble(originalRUN = missing_runs, LogIntensities = NA)
tmp3 <- rbind(tmp, tmp2) %>% arrange(originalRUN) %>% select(LogIntensities)
ptm_df <- cbind(ptm_df, tmp3)
#Normalised PTM abundance
if (!i %in% rownames(assay(pe[["ptmMSstatsRel"]]))){
print(paste(i, "not in normalised PTM data"))
plot_df <- rbindlist(list(protein, ptm_df), fill = TRUE)
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = originalRUN, y = LogIntensities , group = FeatureType, color = FeatureType), size =2) +
geom_point(aes(x = originalRUN, y = LogIntensities , group = FeatureType, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("PTM - normalised" = "lightgoldenrod", "Protein" = "skyblue3",
"PTM" = "seagreen3", "PTM_estimated" = "palevioletred2")) +
#scale_size_manual(values = c(1, 2)) +
labs(title = paste(i, "no normalisation possible"), x = "BioReplicate", y = "LogIntensity") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=10),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0)) +
annotate("text", x = 2.5, y = 27, label = "CCCP", size = 8) +
annotate("text", x = 6.5, y = 27, label = "Combo", size = 8) +
annotate("text", x = 10.5, y = 27, label = "Ctrl", size = 8) +
annotate("text", x = 14.5, y = 27, label = "USP30", size = 8) +
ylim(-7, 27)
plots[[i]] <- p1
next
}
ptm_df_norm <- assay(pe[["ptmMSstatsRel"]])[i,] %>% as.data.frame()
colnames(ptm_df_norm) <- "LogIntensities"
ptm_df_norm <- ptm_df_norm %>%
mutate(Protein = i,
FeatureType = "PTM - normalised",
GROUP = sapply(strsplit(rownames(ptm_df_norm), "-"), function(x) x[1])) %>%
rownames_to_column("originalRUN") %>%
arrange(GROUP)
#PTM estimated
Protein <- rep(i, nrow(ptm_df))
ptm_estimate <- tibble(Protein)
ptm_estimate$originalRUN <- ptm_df$originalRUN
ptm_estimate$GROUP <- ptm_df$GROUP
ptm_estimate$FeatureType <- "PTM_estimated"
ptm_estimate$LogIntensities <- NA
if(rowData(pe[["ptmMSstatsRel"]])$msqrobModels[[i]] %>% getFitMethod() == "fitError"){
print(paste(i, "resulted in a fitError"))
plot_df <- rbindlist(list(protein, ptm_df, ptm_df_norm), fill = TRUE)
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = originalRUN, y = LogIntensities , group = FeatureType, color = FeatureType), size =2) +
geom_point(aes(x = originalRUN, y = LogIntensities , group = FeatureType, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("PTM - normalised" = "lightgoldenrod", "Protein" = "skyblue3",
"PTM" = "seagreen3", "PTM_estimated" = "palevioletred2")) +
#scale_size_manual(values = c(1, 2)) +
labs(title = paste(i, "fitError"), x = "BioReplicate", y = "LogIntensity") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=10),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0)) +
annotate("text", x = 2.5, y = 27, label = "CCCP", size = 8) +
annotate("text", x = 6.5, y = 27, label = "Combo", size = 8) +
annotate("text", x = 10.5, y = 27, label = "Ctrl", size = 8) +
annotate("text", x = 14.5, y = 27, label = "USP30", size = 8) +
ylim(-7, 27)
plots[[i]] <- p1
next
}
fixeffects <- rowData(pe[["ptmMSstatsRel"]])$msqrobModels[[i]] %>% getCoef
try(ptm_estimate[ptm_estimate$GROUP=="Ctrl",]$LogIntensities <-
fixeffects[["(Intercept)"]])
try(ptm_estimate[ptm_estimate$GROUP=="Combo",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("Combo", names(fixeffects))][1])
try(ptm_estimate[ptm_estimate$GROUP=="CCCP",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("CCCP", names(fixeffects))][1])
try(ptm_estimate[ptm_estimate$GROUP=="USP30_OE",]$LogIntensities <-
fixeffects[["(Intercept)"]] + fixeffects[grepl("USP30_OE", names(fixeffects))][1])
plot_df <- rbindlist(list(protein, ptm_df_norm, ptm_df, ptm_estimate), fill = TRUE)
plot_df <- plot_df %>% arrange(FeatureType)
plot_df$originalRUN <- forcats::fct_inorder(plot_df$originalRUN)
plot_points <- plot_df %>% filter(FeatureType != "PTM_estimated")
#plot_df[plot_df$FeatureType == 'Model'][['FeatureType']] <- "PTM Summarized"
#plot_df[plot_df$FeatureType == 'Peptide'][['FeatureType']] <- "PTM Feature"
p1 <- plot_df %>% ggplot() +
geom_line(aes(x = originalRUN, y = LogIntensities , group = FeatureType, color = FeatureType), size =2) +
geom_point(data = plot_points, aes(x = originalRUN, y = LogIntensities , group = FeatureType, color = FeatureType), size = 5) +
geom_vline(data=data.frame(x = c(4.5, 8.5, 12.5)),
aes(xintercept=as.numeric(x)), linetype = "dashed") +
scale_colour_manual(values = c("PTM - normalised" = "lightgoldenrod", "Protein" = "skyblue3",
"PTM" = "seagreen3", "PTM_estimated" = "palevioletred2")) +
#scale_size_manual(values = c(1, 2)) +
labs(title = i, x = "BioReplicate", y = "LogIntensity") +
theme_bw() +
theme(axis.text.x = element_text(angle = 60, hjust=1, size = 16),
axis.text.y = element_text(size = 16),
legend.text=element_text(size=10),
axis.title.y = element_text(size = 22),
axis.title.x = element_text(size = 22),
title = element_text(size = 22),
strip.text = element_text(size = 16),
legend.title = element_blank(),
legend.direction = "horizontal",
legend.position = c(0.5, 0)) +
annotate("text", x = 2.5, y = 30, label = "CCCP", size = 8) +
annotate("text", x = 6.5, y = 30, label = "Combo", size = 8) +
annotate("text", x = 10.5, y = 30, label = "Ctrl", size = 8) +
annotate("text", x = 14.5, y = 30, label = "USP30", size = 8) +
ylim(-10, 30)
plots[[i]] <- p1
}## [1] "A0FGR9_K608 resulted in a fitError"
## [1] "B2RB47_K073 resulted in a fitError"
## [1] "O14980_K0686 resulted in a fitError"
## Error in fixeffects[["(Intercept)"]] : subscript out of bounds
## Error in fixeffects[["(Intercept)"]] : subscript out of bounds
## Error in fixeffects[["(Intercept)"]] : subscript out of bounds
## Error in fixeffects[["(Intercept)"]] : subscript out of bounds
## [1] "O60341_K492 resulted in a fitError"
## [1] "O60361_K109 also significant in msqrob"
## Error in fixeffects[["(Intercept)"]] : subscript out of bounds
## Error in fixeffects[["(Intercept)"]] : subscript out of bounds
## Error in fixeffects[["(Intercept)"]] : subscript out of bounds
## Error in fixeffects[["(Intercept)"]] : subscript out of bounds
## [1] "O60749_K516 resulted in a fitError"
## [1] "O75131_K158 resulted in a fitError"
## [1] "O75150_K440 resulted in a fitError"
## [1] "O75694_K0824 resulted in a fitError"
## [1] "O75694_K1069 resulted in a fitError"
plots## $A0FGR9_K608
## Warning: Removed 20 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
##
## $B2RB47_K073
## Warning: Removed 28 row(s) containing missing values (geom_path).
## Warning: Removed 36 rows containing missing values (geom_point).
##
## $O00154_K205
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 17 rows containing missing values (geom_point).
##
## $O00159_K0578
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 12 rows containing missing values (geom_point).
##
## $O00170_K215
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 18 rows containing missing values (geom_point).
##
## $O00232_K262
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Removed 18 rows containing missing values (geom_point).
##
## $O00267_K0627
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
##
## $O00410_K0806
##
## $O14972_K103
## Warning: Removed 5 row(s) containing missing values (geom_path).
## Warning: Removed 17 rows containing missing values (geom_point).
##
## $O14980_K0686
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $O15372_K274
## Warning: Removed 20 row(s) containing missing values (geom_path).
## Warning: Removed 20 rows containing missing values (geom_point).
##
## $O43175_K289
## Warning: Removed 4 rows containing missing values (geom_point).
##
## $O43670_K100
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
##
## $O43847_K0993
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 26 rows containing missing values (geom_point).
##
## $O60260_K076
## Warning: Removed 2 rows containing missing values (geom_point).
##
## $O60260_K220
##
## $O60260_K369
##
## $O60260_K408
##
## $O60260_K435
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
##
## $O60341_K492
## Warning: Removed 20 row(s) containing missing values (geom_path).
## Warning: Removed 34 rows containing missing values (geom_point).
##
## $O60361_K034
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 18 rows containing missing values (geom_point).
##
## $O60361_K041
##
## $O60361_K070
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
##
## $O60361_K109
##
## $O60361_K113
## Warning: Removed 30 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $O60506_K336
## Warning: Removed 4 rows containing missing values (geom_point).
##
## $O60749_K218
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 17 rows containing missing values (geom_point).
##
## $O60749_K516
## Warning: Removed 20 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
##
## $O60832_K433
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 17 rows containing missing values (geom_point).
##
## $O60888_K082
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 18 rows containing missing values (geom_point).
##
## $O75131_K158
## Warning: Removed 24 row(s) containing missing values (geom_path).
## Warning: Removed 35 rows containing missing values (geom_point).
##
## $O75150_K440
## Warning: Removed 24 row(s) containing missing values (geom_path).
## Removed 35 rows containing missing values (geom_point).
##
## $O75400_K669
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
##
## $O75694_K0740
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Removed 16 rows containing missing values (geom_point).
##
## $O75694_K0824
## Warning: Removed 20 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
##
## $O75694_K0890
## Warning: Removed 6 row(s) containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).
##
## $O75694_K0902
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 18 rows containing missing values (geom_point).
##
## $O75694_K0987
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Removed 18 rows containing missing values (geom_point).
##
## $O75694_K1069
## Warning: Removed 20 row(s) containing missing values (geom_path).
## Warning: Removed 33 rows containing missing values (geom_point).
##
## $O75694_K1126
## Warning: Removed 4 row(s) containing missing values (geom_path).
## Warning: Removed 16 rows containing missing values (geom_point).
for (i in ptm_list1){
print(i)
print(rowData(pe[["ptmMSstatsRel"]])$groupCombo[i,])
}## [1] "A0FGR9_K608"
## logFC se df t pval adjPval
## A0FGR9_K608 NA NA NA NA NA NA
## [1] "B2RB47_K073"
## logFC se df t pval adjPval
## B2RB47_K073 NA NA NA NA NA NA
## [1] "O00154_K205"
## logFC se df t pval adjPval
## O00154_K205 NA NA 6.115833 NA NA NA
## [1] "O00159_K0578"
## logFC se df t pval adjPval
## O00159_K0578 NA NA 6.993305 NA NA NA
## [1] "O00170_K215"
## logFC se df t pval adjPval
## O00170_K215 NA NA 5.115833 NA NA NA
## [1] "O00232_K262"
## logFC se df t pval adjPval
## O00232_K262 NA NA 5.115833 NA NA NA
## [1] "O00267_K0627"
## logFC se df t pval adjPval
## O00267_K0627 NA NA 6.115833 NA NA NA
## [1] "O00410_K0806"
## logFC se df t pval adjPval
## O00410_K0806 3.075823 1.418033 11.07609 2.169077 0.05269811 0.7011021
## [1] "O14972_K103"
## logFC se df t pval adjPval
## O14972_K103 NA NA 6.115833 NA NA NA
## [1] "O14980_K0686"
## logFC se df t pval adjPval
## O14980_K0686 NA NA NA NA NA NA
## [1] "O15372_K274"
## logFC se df t pval adjPval
## O15372_K274 NA NA NA NA NA NA
## [1] "O43175_K289"
## logFC se df t pval adjPval
## O43175_K289 NA NA 9.88883 NA NA NA
## [1] "O43670_K100"
## logFC se df t pval adjPval
## O43670_K100 NA NA 6.115833 NA NA NA
## [1] "O43847_K0993"
## logFC se df t pval adjPval
## O43847_K0993 NA NA 5.115833 NA NA NA
## [1] "O60260_K076"
## logFC se df t pval adjPval
## O60260_K076 2.947903 1.078911 10.05118 2.732297 0.0210186 0.5439243
## [1] "O60260_K220"
## logFC se df t pval adjPval
## O60260_K220 2.945495 0.8255802 11.13382 3.567788 0.004331355 0.2309399
## [1] "O60260_K369"
## logFC se df t pval adjPval
## O60260_K369 1.211412 0.2863608 12.50321 4.23037 0.001068061 0.104403
## [1] "O60260_K408"
## logFC se df t pval adjPval
## O60260_K408 3.212302 0.8237631 11.05165 3.899546 0.002457055 0.1742382
## [1] "O60260_K435"
## logFC se df t pval adjPval
## O60260_K435 NA NA 6.115833 NA NA NA
## [1] "O60341_K492"
## logFC se df t pval adjPval
## O60341_K492 NA NA NA NA NA NA
## [1] "O60361_K034"
## logFC se df t pval adjPval
## O60361_K034 NA NA 5.115833 NA NA NA
## [1] "O60361_K041"
## logFC se df t pval adjPval
## O60361_K041 1.485787 1.261051 11.04014 1.178213 0.2634839 0.9996807
## [1] "O60361_K070"
## logFC se df t pval adjPval
## O60361_K070 NA NA 6.115833 NA NA NA
## [1] "O60361_K109"
## logFC se df t pval adjPval
## O60361_K109 2.924282 0.5490288 11.26627 5.326281 0.0002235512 0.02622256
## [1] "O60361_K113"
## logFC se df t pval adjPval
## O60361_K113 NA NA NA NA NA NA
## [1] "O60506_K336"
## logFC se df t pval adjPval
## O60506_K336 5.149196 3.801191 9.167772 1.354627 0.2079758 0.9996807
## [1] "O60749_K218"
## logFC se df t pval adjPval
## O60749_K218 NA NA 6.115833 NA NA NA
## [1] "O60749_K516"
## logFC se df t pval adjPval
## O60749_K516 NA NA NA NA NA NA
## [1] "O60832_K433"
## logFC se df t pval adjPval
## O60832_K433 NA NA 6.115833 NA NA NA
## [1] "O60888_K082"
## logFC se df t pval adjPval
## O60888_K082 NA NA 5.115833 NA NA NA
## [1] "O75131_K158"
## logFC se df t pval adjPval
## O75131_K158 NA NA NA NA NA NA
## [1] "O75150_K440"
## logFC se df t pval adjPval
## O75150_K440 NA NA NA NA NA NA
## [1] "O75400_K669"
## logFC se df t pval adjPval
## O75400_K669 NA NA 6.115833 NA NA NA
## [1] "O75694_K0740"
## logFC se df t pval adjPval
## O75694_K0740 NA NA 6.115833 NA NA NA
## [1] "O75694_K0824"
## logFC se df t pval adjPval
## O75694_K0824 NA NA NA NA NA NA
## [1] "O75694_K0890"
## logFC se df t pval adjPval
## O75694_K0890 NA NA 6.115833 NA NA NA
## [1] "O75694_K0902"
## logFC se df t pval adjPval
## O75694_K0902 NA NA 5.115833 NA NA NA
## [1] "O75694_K0987"
## logFC se df t pval adjPval
## O75694_K0987 NA NA 5.115833 NA NA NA
## [1] "O75694_K1069"
## logFC se df t pval adjPval
## O75694_K1069 NA NA NA NA NA NA
## [1] "O75694_K1126"
## logFC se df t pval adjPval
## O75694_K1126 NA NA 6.115833 NA NA NA